﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Antlr.Runtime.Tree;
namespace GxcToCsharpParser.TreeWalkers
{
   public class INIComponentMaker
   {
      public void WalkTree(CommonTree tree)
      {


         if (tree == null)
            return;
         if (tree.Type == gxc2csharp.Translator.GxcToCTransform.GxcParser.FUNCTION_CALL)
         {
            ITree funtion_call = tree.GetChild(0);
            switch(funtion_call.Text)
            {
               case "Create_DGW":
                  Console.WriteLine("Dialog created");
                  break;
               case "SetInfoSYS_DGW":
                  Console.WriteLine("Set Dialog item called ");
                  break;
               case "GetInfoSYS_DGW":
                  Console.WriteLine("Get Dialog item called ");
                  break;


            }
            return;
            
            
         }

         
         if (tree.Children == null)
            return;

         foreach (var child in tree.Children)
         {
            CommonTree node = (CommonTree)child;
            WalkTree(node);
         }
      }
   }
}
